﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CaronteFX;
using System;


/// <summary>
/// 坍塌动画的水泥板
/// </summary>
public class TanTaShuiNiBan : MonoBehaviour 
{
    private CRAnimation posuiAni;
    public event Action onPlayAnimation; 

    void Awake()
    {
        posuiAni = transform.GetComponent<CRAnimation>();
    }
	
    public  void PlayAnimation()
    {
        Invoke("DelayPlay",3f);
    }

    private void DelayPlay()
    {
        Debug.Log("动画");
        posuiAni.animate = true;
        transform.GetComponentInChildren<BoxCollider>().enabled = false;
        onPlayAnimation();
    }


}
